package com.dacd.soundanalysis.filehelper

import java.io.File

class FileHelper {

    companion object {
        /**
         * 存储文件
         */
        fun saveFile(dirPath: String, fileName: String, content: String) {
            val fileDir = File(dirPath)
            if(!fileDir.exists()) {
                fileDir.mkdirs()
            }
            val recordFile = File(dirPath, fileName)
            if (recordFile.exists()) {
                recordFile.delete()
            }
            File(recordFile.absolutePath).writeText(content)
        }
    }

}